package com.example.shardingsphere.service;

import com.example.shardingsphere.controller.param.UserLoginParam;
import com.example.shardingsphere.controller.param.UserParam;
import com.example.shardingsphere.controller.param.UserPasswordLoginParam;
import com.example.shardingsphere.controller.result.TableDataInfo;
import com.example.shardingsphere.controller.result.UserLoginResult;
import com.example.shardingsphere.entity.User;

import java.util.List;

public interface UserService {
    /**
     * 查询用户信息
     * 普通用户仅自己，管理员所有普通用户，超管全部
     */
    User getUserById(Long userId);

    List<User> getAllUsers();

    Integer register(User user);

    /**
     * 登录
     *
     * @param param
     * @return
     */
    UserLoginResult login(UserLoginParam param) throws Exception;

    /**
     * 获取用户列表
     *
     * @param pageNum
     * @param pageSize
     * @return
     */
    TableDataInfo<User> getUserList(int pageNum, int pageSize);

    Boolean canUpdateUser(Long userId, UserParam userParam);

    Boolean resetPassword(Long userId, String oldPassword, String newPassword);

}